home *** CD-ROM | disk | FTP | other *** search
- function sampleFunc;
-
- description 'Some words about',
- 'the function';
-
- parameters 2;
- defaults a[1]:=0,active,'delta',-1,1;
- a[2]:=3,inactive,'beta',-inf,inf;
-
- const c=2.99792458e8;
-
- var firsttime: boolean;
- ex1,ex2,sqrx: extended;
-
-
-
- procedure initialize;
- begin
- firsttime:=true;
- end;
-
- function check;
- begin
- check:=OK;
- if (pNumber=2) and (a[2]=0) then
- check:=BAD;
- end;
-
- procedure first;
- begin
- if firsttime then
- begin
- firsttime:=false;
- ex1:=data[1,1]/c;
- end;
-
-
- ex2:= a[1] * ex1;
- end;
-
- procedure derivatives;
- begin
- dyda[1]:= sqrx*ex1;
- dyda[2]:= -x/sqr(a[2]);
- end;
-
- procedure last;
- begin
- beep;
- firsttime:=true;
- end;
-
- begin
- sqrx:=sqr(x);
- y:= sqrx*ex2 + x/a[2];
- end;
-
-
- program makeTable;
-
- const tableLength=10;
- var paramNum,i:integer;
- x,pVal, oldpVal:extended;
- step:extended;
-
- procedure initialize;
- begin
- paramNum:=1;
- x:=pi;
- step:=pi/10;
- end;
-
-
-
- function myfunc (ex1: extended):extended;
- begin
- myfunc:=callfunction('',ex1);
- end;
-
- begin
- input('tabulate which parameter?',paramNum,step,x);
- pVal:=getFunctionParam('',paramNum);
- oldpVal:=pVal;
- for i:=1 to tableLength do
- begin
-
-
- setFunctionParam('',paramNum, pVal);
- data[i,1]:=pVal;
- data[i,2]:=myfunc(x);
- pVal:=pVal+step;
- end;
- setFunctionParam('',paramNum, oldpVal);
- end;
-
-
-
-
-
- function name;
- begin
- y:= a[1]*sin(x) + a[2]*x;
- end;
-
-
- program name;
- const col1=1;
- col2=2;
- var i:integer;
- begin
- for i:=1 to nrRows do
- if dataok(i,col1) then
- begin
- data[i,col2]:=sqr(data[i,col1]) +1;
- end;
- end;
-
- procedure myproc (i:integer; k: extended);
- begin
- data[1,i]:=abs(k);
- end;
-
-
- function myfunc (ex1,ex2: extended): extended;
- begin
- myfunc:=sin(ex1) + ex2;
- end;
-
-
- description 'text1', 'text2';
-
-
- parameters 3;
-
-
- defaults a[1]:=1.0, active, 'var1',0,inf;
-
-
- const c=2.99792458e8;
- mu0=1.256637061435917295e-6;
- eps0=8.854187817e-12;
- G=6.67259e-11;
- h=6.6260755e-34;
- hbar=1.05457266e-34;
- e=1.60217733e-19;
- me=9.1093897e-31;
- k=1.380658e-23;
-
- var globalVar: extended;
- myArray: array [1..3] of extended;
-
-
- repeat
- statements;
- x:=x+0.1;
- until x>limit;
-
-
- for i:=1 to nrRows do
- begin
- statements;
- end;
-
-
- for i:=nrCols downto 1 do
- begin
- statements;
- end;
-
-
- while i<j do
- begin
- statements;
- end;
-
-
- if x>0 then
- begin
- statements;
- end;
-
-
- if a[1]>0 then
- begin
- statements;
- end
- else
- begin
- statements;
- end;
-
-
- procedure initialize;
- begin
- global:=0;
- end;
-
-
- function check;
- begin
- check:=OK;
- if (pNumber=1) and (a[1]<0) then
- check:=BAD;
- end;
-
-
- procedure first;
- begin
- global:=1*π*a[1]^0.42;
- end;
-
-
- procedure derivatives;
- begin
- dyda[1]:=0;
- end;
-
-
- procedure last;
- begin
- beep;
- end;
-
-
-